home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 September / Chip_2000-09_cd1.bin / sharewar / Slunec / app / 16 / MOD.SWG / 0058_PLM - Disorder Tracker 2.pas < prev    next >
Pascal/Delphi Source File  |  1997-05-11  |  5KB  |  153 lines

  1. ;----------------------------------------------------------------------------
  2. ; DisorderTracker2 file  FORMAT STARTS HERE
  3. ;----------------------------------------------------------------------------
  4.  
  5. well here it comes... I am converting this from the source
  6. code now, as I type, so I hope it is right!
  7.  
  8. this is (c) statix 1995... and I accept no responsibility for errors
  9. in here,
  10. if there is a problem contact me --> statix@sv.span.com...
  11.  
  12. here is a list of fields in a .PLM file, I assume you know some
  13. coding??
  14.  
  15. name            length (bytes)  description
  16. =======================================================================
  17. ID        4        marker, always "PLM" then character 26
  18. headersize    1        number of bytes in header, including ID etc
  19. version        1        version code of file format, 10h, I think
  20. songname    48        ASCIIZ string
  21. channels    1        number of channels
  22. flags        1        flags byte, ignore this!
  23. maxvol        1        maximum volume for vol slides, normally 40h
  24. amplify        1        soundblaster amplify, 40h=no amplify
  25. initbpm        1        starting bpm of song, normally 125
  26. initspeed    1        starting speed of song, normally 6
  27. initpan        32        starting pan positions, always 32, 0=left,
  28.                 15=right
  29. numsamps    1        number of samples in file
  30. numpats        1        number of patterns in file
  31. numorders    2        number of orders in file
  32. padding        1        ignore...
  33.  
  34. ; now seek "headersize" bytes from the beginning of the file,
  35. (normally no
  36. ; change) now:
  37.  
  38. orderlist    4*numorders    a list of orders, format coming
  39. later...
  40. patternlist    4*numpats    a list of file offsets of the patterns
  41. (dwords)
  42. samplelist    4*numsamps    a list of file offsets of the samples
  43. (dwords)
  44.  
  45. ; now read in the patterns, which are uncompressed.
  46. ; for each pattern, seek to the place in the file in the patternlist,
  47. and the
  48. ; format is below. (NOTE: if the patternlist has a position of 0, skip
  49. to next
  50. ; pattern)
  51.  
  52. patternsize      4 (dword)    number of bytes this pattern takes in
  53. file
  54. len        byte        # rows
  55. wid        byte        # channels
  56. col        byte        colour
  57. name        25 bytes    name,asciiz string
  58.  
  59. ;now the notes in the pattern, stored a row at a time, with "wid"
  60. channels
  61. ;in each row. the note format is:
  62.  
  63. pitch        byte        hi nybble is octave, lo nybble is note (C=0,
  64.                 C#=1, D=2 etc). 0=blank
  65. sample        byte        sample number. 0=blank
  66. vol        byte        volume. 0ffh=blank. NOTE! big volumes >64
  67.                 are allowed!
  68. cmd        byte        command number
  69. nfo        byte        command info
  70.  
  71.  
  72. ; now read in the samples, which are uncompressed.
  73. ; for each sample, seek to the place in the file in the samplelist,
  74. and the
  75. ; format is below. (NOTE: if the samplelist has a position of 0, skip
  76. to next
  77. ; sample)
  78.  
  79. ;in fact each sample is stored in the .PLM file as a complete .PLS
  80. sample file.
  81. ;The .PLS format is as follows:
  82.  
  83. id        4 bytes        always "PLS" then character 26
  84. headersize    1 byte        size of header in bytes, including ID etc
  85. version        1 byte
  86. fullname    32 byte           ; NOT asciiz
  87. filename    12 byte           ; ditto
  88. pan        byte           ; default pan, 0..f, >f=none
  89. vol        byte           ; default vol 0..40h
  90. flags        byte           ; 1 = 16 bit , 0=8 bit
  91. c4spd        word           ; c4spd (as for S3M)
  92. gusloc        dword           ; posn in gusram (not used in file)
  93. loopst        dword           ; loopstart
  94. loopen        dword           ; loopend
  95. len        dword           ; data size IN BYTES
  96. data        lots of bytes       ; unsigned data
  97.  
  98. ; default pan changes the pan on that channel when the sample is
  99. CHANGED
  100. ; to that sample, experiment in dt2 to see what I mean...
  101.  
  102. ; note that default volume does NOT work like MOD or S3M default
  103. volume.
  104. ; default volume actually multiplies the volume field for that sample,
  105. so
  106. ; a default volume of 40h plays the sample as written in the file. a
  107. ; default volume of 20h always plays the sample half as loud as
  108. written in
  109. ; the file . This is a better system, I think... (more logical?!?)
  110.  
  111. ; finally I will explain the format of the orderlist. Each one is 4
  112. bytes,
  113. ; and is:
  114.  
  115. x        word        ; starting position of pattern
  116. y        byte        ; channel number of first channel of pattern
  117. pattern        byte        ; number of pattern
  118.  
  119. ; I think that will make sense, If you see how dt2 works... note that
  120. is
  121. ; is very important to remember that patterns can overlap. In this
  122. case,
  123. ; the pattern with the higher x takes priority. If they have the same
  124. x,
  125. ; then it is the one with the higher pattern number. You can see this
  126. in
  127. ; dt2 by dragging patterns around on the over view screen.
  128.  
  129. ; of course, this system with x and y for each pattern is what makes
  130. dt2
  131. ; unique, and also so hard to play with a standard player!!!
  132.  
  133. hope that helps, and I have not made any errors... any questions, just
  134. email.
  135.  
  136.  
  137. ;---------------------------------------------------------------------------
  138. ; END OF DT2 FORMAT
  139. ;---------------------------------------------------------------------------
  140.  
  141. ps If you want to spread that format, go ahead but please only spread
  142. with
  143. *ALL* of it, starting from the line that says "format starts here..."
  144.  
  145. thankyou...
  146.  
  147. ---------------------------------------------------------------------------
  148.  
  149. With formats like PLM, with the identifier at the start of the file,
  150. it's very easy to rip them, just extract everthing after the marker..
  151.  
  152.  
  153.